package com.brillilab.dao.mapper.lab;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.brillilab.domain.po.lab.LabMember;
import com.brillilab.domain.vo.lab.LabMemberInfo;
import com.brillilab.domain.vo.lab.LabMemberSelector;
import com.brillilab.domain.vo.lab.LabMemberVo;
import com.brillilab.domain.vo.lab.MemberInfoVo;
import com.brillilab.domain.vo.user.UsersVo;

/**
 * 实验室成员Mapper
 *
 * @author lj
 */
public interface LabMemberMapper extends BaseMapper<LabMember> {

    List<LabMemberVo> selectByPower(@Param("labId") Long labId, @Param("power") String power);

    List<LabMemberSelector> selectIdAndNameByState(@Param("labId") Long labId, @Param("state") Integer state);

    List<LabMemberInfo> selectLabMemberInfo(List<Long> labMemberIdList);

    List<LabMemberInfo> selectLabMemberInfoByLabId(Long labId);

    List<LabMemberVo> selectVoList(@Param("labId") Long labId, @Param("state") Integer state);
    
    List<LabMemberVo> selectVoPage(@Param("labId") Long labId, @Param("state") Integer state, @Param("startRow") Integer startRow, @Param("pageSize") Integer pageSize);

    LabMemberVo selectVo(@Param("labMemberId") Long labMemberId);

    List<LabMemberVo> searchLabMember(@Param("name") String name, @Param("labId") Long labId);

    List<LabMember> selectPoList(@Param("labId") Long labId, @Param("state") Integer state);

    List<LabMember> selectPoListByIds(@Param("memberIds") List<Long> memberIds);

    /**
     * 获取指定实验室最新加入的top条成员列表
     *
     * @param top   前top条记录
     * @param labId 实验室Id
     * @return
     */
    List<LabMember> getTopLastJoinLabList(@Param("top") Integer top, @Param("labId") Long labId);

    /**
     * 获取指定实验室最新加入的成员列表
     *
     * @param labId 实验室Id
     * @return
     */
    List<LabMember> getLastJoinLabList(@Param("labId") Long labId);

	List<UsersVo> selectMemberByPower(@Param("labId")Long labId, @Param("powerList") List<String> powerList);

    List<LabMemberVo> selectBaseVoList(@Param("labMemberIds") List<Long> labMemberIds);
    
    List<MemberInfoVo> selectMemberVoList(@Param("labId") Long labId, @Param("state") Integer state);
    
    List<MemberInfoVo> selectMemberVoListByIds(@Param("labMemberIds") List<Long> labMemberIds);

	List<Long> selectMemberIds(@Param("labId") Long labId, @Param("state") Integer state);
}
